// author:zandaoguang
import Vue from 'vue'
import JsEncrypt from 'jsencrypt'

function getCode(obj) {
    console.log("我已经进入encruption了")
    let encrypt = new JSEncrypt();
    encrypt.setPublicKey
    (
      `-----BEGIN PUBLIC KEY-----
      MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAndYulZS6espqkERwaJAATbvGW2fvaeRlxjw1ll9f7OHHT2MqM6ZnJiTn3tGh8FGTE6CMc3I78T/g3gpWv/pf4PYUmUcPXjKf+3EaWeCJQ8ovLwjBZbIGtl1bFX3BQzNFTHbyZlkpUC9Lcx0+n7DNmo/kEWzae9lFFLv9WIAN04ojYcmKO2DVFSxHh6/ODIMPIRwFuDUOE8vkZV1PX7/R48XsIH7FJTfIBhQB57Moo19u2Hu6PyJI3AwABJQpsKyI0jtJ0r0MX3oZlkQb+5XCLg5VZTGGEnbSInS9/Qo+osUQiJMTbtu+9tu6XD1WAHTwQY+ChDa0GfIGvAVXjQi8fQIDAQAB
      -----END PUBLIC KEY-----`
    )
    // console.log("encry:"+encrypt.encrypt(obj));
    return encrypt.encrypt(obj);
  }